package com.gxgeek.javabasic.Thread;

import lombok.extern.slf4j.Slf4j;

/**
 * Created by GX on 2017/8/28.
 */
@Slf4j
public class TestThreadLoad {

    private static  ThreadLocal<String> local = new ThreadLocal<>();

    public static void main(String[] args) throws InterruptedException {
        local.set("main");
        log.info(local.get());
        Thread childThread  = new Thread(()->{
            local.set("child");
            log.info(local.get());
        });
        childThread.start();
        childThread.join();
        log.info(local.get());
    }

    public void set(){


        System.out.println(local.get());






    }

}
